package com.ask.controller;

import com.ask.domain.Book;
import com.ask.service.BookService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping( "/books")
@Api(tags = "book接口")
public class BookController {



    @RequestMapping( "/test")
    @ApiOperation("测试接口")
    public String test(){
        System.out.println("visit");
        return "{'test' : 'ad'}";
    }

    @PostMapping("/save")
    public boolean add(@RequestBody Book book){
//        bookService.save(book);
        System.out.println(book);
        return true;
    }
}
